package com.etc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;

@Service
public class ServiceB2 {
	@Autowired
    RestTemplate restTemplate;
	
	@HystrixCommand(fallbackMethod = "hiError")
	public String rpc(String value) {
		 return restTemplate.getForObject("http://tx-bank2/testb?value=1"+value,String.class);
	}

    public String hiError(String value) {
        return "hi,"+value+",sorry,error!";
    }
}
